package com.sdp.irrigation.db.irrigation_project.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sdp.irrigation.db.irrigation_project.mapper.IrrigationProjectMapper;
import com.sdp.irrigation.db.irrigation_project.service.IIrrigationProjectService;
import com.sdp.irrigation.entity.IrrigationProject;

/**
 * <p>
 * 项目台账信息 服务实现类
 * </p>
 *
 * @author zsp
 * @since 2024-12-14
 */
@Service
public class IrrigationProjectServiceImpl extends ServiceImpl<IrrigationProjectMapper, IrrigationProject> implements IIrrigationProjectService {

	@Override
	public List<IrrigationProject> queryAllProject() {
		LambdaQueryWrapper<IrrigationProject> lambdaQueryWrapper = new LambdaQueryWrapper<>();
		lambdaQueryWrapper.orderByDesc(IrrigationProject::getCreateTime);
		return list(lambdaQueryWrapper);
	}

	@Override
	public List<IrrigationProject> queryProjectByNos(List<String> projectNos) {
		LambdaQueryWrapper<IrrigationProject> lambdaQueryWrapper = new LambdaQueryWrapper<>();
		lambdaQueryWrapper.in(IrrigationProject::getProjectNo, projectNos);
		return list(lambdaQueryWrapper);
	}

}
